package com.tongji.showroom.command
{
	import com.tongji.showroom.events.DeleteProductEvent;
	import com.tongji.showroom.service.DeleteProductService;
	
	import org.robotlegs.mvcs.Command;
	
	/**
	 * 
	 * @author jiarong
	 * 2011-11-1
	 *
	 */
	
	public class DeleteProductCommand extends Command
	{
		[Inject]
		public var event:DeleteProductEvent;
		
		[Inject]
		public var service:DeleteProductService;
		
		public function DeleteProductCommand()
		{
			super();
		}
		
		override public function execute():void
		{
			switch(event.type)
			{
				case DeleteProductEvent.DELETE_PRODUCT:
					service.deleteProduct(event.Id);
					break;
			}
		}
	}
}